﻿using FolderTag.Model;

namespace FolderTag.DB.Dbo
{
    [SQLBuilder.Core.Attributes.Table("quick_path")]
    public class QuickPathDbo
    {
        /// <summary>
        /// 编号
        /// </summary>
        [SQLBuilder.Core.Attributes.Key]
        public int? Id { get; set; }
        /// <summary>
        /// 路径
        /// </summary>
        public string Path { get; set; }


        /// <summary>
        /// 创建对象
        /// </summary>
        /// <returns></returns>
        public static QuickPathDbo Create(QuickPathItem pathItem)
        {
            QuickPathDbo result = new QuickPathDbo()
            {
                Id = pathItem.Id,
                Path = pathItem.Path,
            };
            return result;
        }
        /// <summary>
        /// 创建对象
        /// </summary>
        /// <returns></returns>
        public static QuickPathDbo CreateNew(QuickPathItem pathItem)
        {
            QuickPathDbo result = Create(pathItem);
            result.Id = null;
            return result;
        }
    }
}
